import type { App } from 'vue';
import { createH5RouterInstance } from '@/hooks/business/use-h5-router';

/**
 * 设置全局H5Router服务
 * 提供window.$h5Router全局访问
 */
export function setupH5Router(app: App) {
  // 创建H5Router实例
  const h5RouterInstance = createH5RouterInstance();

  // 注册到window全局对象
  window.$h5Router = h5RouterInstance;

  // 注册为Vue应用全局属性（可选，主要使用window.$h5Router）
  app.config.globalProperties.$h5Router = h5RouterInstance;

  console.log('✓ H5Router全局服务已初始化');
}
